import 'package:flutter/material.dart';

class SizeFit {
  static double scaleFactor = 1; // 添加默认值 1

  static void initialize(BuildContext context, {double standardWidth = 375.0}) {
    double screenWidth = MediaQuery.of(context).size.width;
    scaleFactor = screenWidth / standardWidth;
  }

  static double setPx(double size) {
    return SizeFit.scaleFactor * size;
  }
}
